package com.consult.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.consult.config.dto.AjaxResult;
import com.consult.entity.Finish;
import com.consult.service.IFinishService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-06-22
 */
@RestController
@RequestMapping("/finish")
public class FinishController {

    @Resource
    public IFinishService finishService;

    @PostMapping("/add")
    public AjaxResult addFinish(@RequestBody Finish finish) {
        finishService.save(finish);
        return AjaxResult.success();
    }

    @PostMapping("/page")
    public AjaxResult getFinishPage(@RequestBody Page<Finish> page) {
        page = finishService.getFinishPage(page);
        return AjaxResult.success(page);
    }
}

